<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理页面</title>
<link href="{webroot}theme/admin/css/iframe.css" rel="stylesheet" type="text/css" />
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/js/base.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/js/jquery.vtip.js"></script>
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}theme/admin/js/admin.js"></script>
<script src="{webroot}lib/dialog/artdialog.js"></script>
<!--[if lt IE 9]>
<script src="{webroot}lib/js/html5.js"></script>
<![endif]-->
<script>
$(function(){
	$(".del").click(function(){
		var id;
		var that=this;
		sid=$(this).attr("rel");
			top.dialog({
				content:'\u786e\u5b9a\u8981\u5220\u9664\uff1f\u4e0d\u53ef\u6062\u590d\uff01',
				ok:function(){
					var url,data;
					url='?act=did&id={id}&sid='+sid;
					$.ajax({
					type:"get",
					cache:false,
					url:url,
					success:function(_)
					{
						if(_.substring(0,1)==0)
						{
							$.fn.tips({type:"error",content:_.substring(1)});
						}
						else
						{
							$.fn.tips({type:"ok",content:"\u5220\u9664\u6210\u529f"});
							setTimeout("location.href='?act=list&id={id}'",1000);
						}
					}
					});
									
					},
				cancel:true 
			}).showModal();
		
		})		
})
</script>
</head>
<body>

<div class="layout-center">
	<div class="right_subject">当前位置：栏目 > <a href="?">表单管理</a> > <a href="?act=list&id={id}">数据列表</a></div>
    <div class="right_body">
        <div class="table_title">
        {datadb(0,0)}{dim tablename:tablename=datadb(1,0)}
        </div>
        <table id="tablelist">
            <thead>
                <tr>
                    <th width="40">ID</th>
                    {if ubound(fdata)>=0}{for i=0 to ubound(fdata,2)}
                    <th>{fdata(0,i)}</th>
                    {/for}{/if}
                    <th width="120">IP</th>
                    <th width="160">提交日期</th>
                    <th width="120">管理</th>
                </tr>
            </thead>
            <tbody>
            {dim islist:islist=1}
            {sdcms:rs table="[tablename]" order="id desc" pagesize="20" isadminurl="0"}
            {rs:eof}
            </tbody>
            </table>
            <%islist=0%>
            <table id="tablelist" style="margin-top:-1px;">
            <tr>
                <td>没有资料</td>
            </tr>
            </table>
            <table id="tablelist">
            {/rs:eof}
            <tr>
                <td>{$rs[id]}</td>
                {if ubound(fdata)>=0}{for i=0 to ubound(fdata,2)}
                <td><%=rs(""&fdata(1,i)&"")%></td>
                {/for}{/if}
                <td>{$rs[userip]}</td>
                <td>{$rs[createdate]}</td>
                <td><a href="?act=show&sid={$rs[id]}&id={id}">查看</a>　<a href="javascript:;" class="del" rel="{$rs[id]}">删除</a></td>
            </tr>
            {/sdcms:rs}            
        </table>
        {if islist=1}
        <div class="table_bottom">
            {showpage}
        </div>
        {/if}
    </div>
</div>
</body>
</html>